package com.klb.tools;

import java.util.List;
import java.util.Map;

/**
 * Created by fujia on 2016/5/25.
 */
public class Tools {


    // 判断对象是否存在
    public static boolean objectIsNullOrNot(Object object) {

        if (object == null) {
            return true;
        }

        if(object instanceof String && object == ""){
            return true;
        }

        if (object instanceof List<?> && ((List<?>) object).size() == 0) {
            return true;
        }

        if (object instanceof Map<?, ?> && ((Map<?, ?>) object).size() == 0) {
            return true;
        }

        return false;
    }
}
